package com.alfred.redis.intercept;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截器配置类
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private CustomInterceptor customInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        //1、接口限流拦截器
        //添加自定义的[customInterceptor]拦截器到InterceptorRegistry拦截器注册表中
        //拦截/**下的所有请求
        registry.addInterceptor(customInterceptor).addPathPatterns("/**");

        //2、访问日志拦截器

        //3、认证授权拦截器
    }
}
